Unit Unity_BekleyenSiparisler;

Interface

Uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, StdCtrls, Buttons, ExtCtrls, Grids, Wwdbigrd,
  Wwdbgrid;

Type
  TUnity_BekleyenSiparislerF = Class(TForm)
    BekleyenSiparisler: TADOQuery;
    BekleyenSiparislerS: TDataSource;
    wwDBGrid1: TwwDBGrid;
    Panel1: TPanel;
    bkapat: TBitBtn;
    Procedure FormClose(Sender: TObject; Var Action: TCloseAction);
    Procedure bkapatClick(Sender: TObject);
    Procedure wwDBGrid1TitleButtonClick(Sender: TObject;
      AFieldName: String);
    Procedure FormShow(Sender: TObject);
    Procedure FormKeyPress(Sender: TObject; Var Key: Char);
  Private
    { Private declarations }
  Public
    { Public declarations }
  End;

Var
  Unity_BekleyenSiparislerF: TUnity_BekleyenSiparislerF;
  siras: String;
  bk: String[5];

Implementation

Uses data;

{$R *.dfm}

Procedure TUnity_BekleyenSiparislerF.FormClose(Sender: TObject;
  Var Action: TCloseAction);
Begin
  BekleyenSiparisler.Close;

  Action := Cafree;
  Unity_BekleyenSiparislerF := Nil;
End;

Procedure TUnity_BekleyenSiparislerF.bkapatClick(Sender: TObject);
Begin
  close;
End;

Procedure TUnity_BekleyenSiparislerF.wwDBGrid1TitleButtonClick(
  Sender: TObject; AFieldName: String);
Begin
  If uppercase(AFieldName) = uppercase(siras) Then
  Begin
    If bk = ' ASC' Then
      bk := ' DESC'
    Else
      bk := ' ASC';
  End
  Else
    bk := ' ASC';

  siras := AFieldName;
  BekleyenSiparisler.Sort := siras + bk;
End;

Procedure TUnity_BekleyenSiparislerF.FormShow(Sender: TObject);
Begin
  YerAyarla(Unity_BekleyenSiparislerF, false);

  BekleyenSiparisler.Open;
End;

Procedure TUnity_BekleyenSiparislerF.FormKeyPress(Sender: TObject;
  Var Key: Char);
Begin
  If key = #27 Then
    close;
End;

End.
